package com.naizhuai.Model.db.user;

import android.arch.persistence.room.Dao;
import android.arch.persistence.room.Insert;
import android.arch.persistence.room.OnConflictStrategy;
import android.arch.persistence.room.Query;

import com.naizhuai.Model.db.Tables;

/**
 * @author：lichenxi
 * @date 2018/2/27 11
 * email：525603977@qq.com
 * Fighting
 */
@Dao
public interface UserDao {

    @Query("SELECT * FROM "+ Tables.USER_TABLE+" where phone=:phone" )
    PersonUserBean searchUserByPhone(String phone);

    @Query("SELECT * FROM "+ Tables.USER_TABLE+" where uid=:uid" )
    PersonUserBean searchUserByUid(String uid);

    @Insert(onConflict = OnConflictStrategy.REPLACE)
    void saveUser(PersonUserBean user);

}
